const webpack = require("webpack");
const chalk = require("chalk");
const WebpackDevServer = require("webpack-dev-server");
const config = require("./webpack.client")();

(() => {
  new WebpackDevServer(webpack({ ...config, watch: true }), {
    publicPath: config.output.publicPath,
    hot: true,
    historyApiFallback: true,
    openPage: "http://www.local.devbitgame.com:7001",
  }).listen(7001, "www.local.devbitgame.com", function (err, result) {
    if (err) throw err;
    console.log(
      chalk.green("Listening at http://www.local.devbitgame.com:7001/")
    );
  });
})();
